package club.banyuan.reserve.controller.api;

import club.banyuan.reserve.common.CommonResult;
import club.banyuan.reserve.dto.PositionParam;
import club.banyuan.reserve.service.AdminSeatService;
import club.banyuan.reserve.vo.PositionVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @author HanChao
 * 描述信息：
 */
@RestController
@RequestMapping(value = "/api/amdin/seat")
public class AdminSeatController {

    @Autowired
    private AdminSeatService adminSeatService;

    @GetMapping(value = "/list")
    public CommonResult list () {

        List<PositionVo> list = adminSeatService.showPositionList();

        return CommonResult.success(list);
    }

    @PostMapping(value = "/edit")
    public CommonResult edit (@RequestBody PositionParam param) {

        adminSeatService.editPositionByParam(param);

        return CommonResult.success("OK");
    }
}
